import xlrd


class ReadXls(object):
    def __init__(self, filename=r"E:\tester79\woniusales_ui_test5_ddt\data\ddt_testwoniusales.xls", sheet="Sheet1"):
        self.filename = filename
        self.sheet = sheet

    def read_datas(self):
        wb = xlrd.open_workbook(self.filename)
        mysheet = wb.sheet_by_name(self.sheet)
        filds = mysheet.row_values(0)
        data_list = []
        for rowdata in range(1, mysheet.nrows):
            dict_row_data = dict(zip(filds, mysheet.row_values(rowdata)))
            data_list.append(dict_row_data)
        return data_list


if __name__ == '__main__':
    print(ReadXls().read_datas())
